#include "els.h"
int ELSAPI_stdsys_sys_getos(els_VmObj* vm); // sys_getos(): str '从内核中获取所在操作系统信息，一般为 Windwos/Linux'
int ELSAPI_stdsys_sys_getenv(els_VmObj* vm); // sys_getenv(n: str) '获取名称为n的环境变量'
int ELSAPI_stdsys_sys_system(els_VmObj* vm); // sys_system(cmd: str): int '调用一个命令'
int ELSAPI_stdsys_sys_popen(els_VmObj* vm); // sys_popen(cmd: str, mod:str): ptr '创建一个管道，mod可取为 r,w'
int ELSAPI_stdsys_sys_pwrite(els_VmObj* vm); // sys_pwrite(p: ptr,s: str): int '向指定管道 p 写入 s'
int ELSAPI_stdsys_sys_pread(els_VmObj* vm); // sys_pread(p: ptr, n: int): int '从指定管道 p 读取 n 个字符'
int ELSAPI_stdsys_sys_pclose(els_VmObj* vm); // sys_pclose(p: ptr): int '关闭一个管道'
#ifdef ELS_CONF_TOKEN_EN
static const char LibScript[]={
115,121,115,61,123,125,10,
115,121,115,46,103,101,116,111,115,32,32,61,32,115,121,115,95,103,101,116,111,115,10,
100,101,102,32,115,121,115,46,103,101,116,101,110,118,40,110,97,109,101,41,58,10,
32,32,32,32,114,101,116,117,114,110,32,115,121,115,95,103,101,116,101,110,118,40,110,97,109,101,41,10,
59,10,
100,101,102,32,115,121,115,46,112,111,112,101,110,40,99,109,100,44,109,111,100,41,58,10,
32,32,32,32,118,97,114,32,116,104,105,115,32,61,32,123,125,10,
10,
32,32,32,32,116,104,105,115,46,80,32,61,32,115,121,115,95,112,111,112,101,110,40,99,109,100,44,109,111,100,41,10,
10,
32,32,32,32,105,102,32,33,116,104,105,115,46,80,32,58,32,114,101,116,117,114,110,32,110,117,108,108,32,59,10,
10,
32,32,32,32,100,101,102,32,116,104,105,115,46,119,114,105,116,101,40,115,41,58,10,
32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,115,121,115,95,112,119,114,105,116,101,40,116,104,105,115,46,80,44,115,41,10,
32,32,32,32,59,32,32,10,
32,32,32,32,100,101,102,32,116,104,105,115,46,114,101,97,100,40,105,41,58,10,
32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,115,121,115,95,112,114,101,97,100,40,116,104,105,115,46,80,44,105,41,10,
32,32,32,32,59,10,
32,32,32,32,100,101,102,32,116,104,105,115,46,99,108,111,115,101,40,41,58,10,
32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,115,121,115,95,112,99,108,111,115,101,40,116,104,105,115,46,80,41,10,
32,32,32,32,59,10,
10,
32,32,32,32,114,101,116,117,114,110,32,116,104,105,115,10,
59,32,10,
10,
100,101,102,32,115,121,115,46,115,121,115,116,101,109,40,99,109,100,41,58,10,
32,32,32,32,114,101,116,117,114,110,32,115,121,115,95,115,121,115,116,101,109,40,99,109,100,41,10,
59,10,
0};
#endif
#ifdef ELS_CONF_TOKEN_CN
static const char LibScript_cn[]={
-25,-77,-69,-25,-69,-97,61,123,125,10,
-25,-77,-69,-25,-69,-97,46,-26,-109,-115,-28,-67,-100,-25,-77,-69,-25,-69,-97,32,32,61,32,115,121,115,95,103,101,116,111,115,10,
100,101,102,32,-25,-77,-69,-25,-69,-97,46,-25,-114,-81,-27,-94,-125,-27,-113,-104,-23,-121,-113,40,110,97,109,101,41,58,10,
32,32,32,32,114,101,116,117,114,110,32,115,121,115,95,103,101,116,101,110,118,40,110,97,109,101,41,10,
59,10,
100,101,102,32,-25,-77,-69,-25,-69,-97,46,-26,-106,-80,-24,-65,-101,-25,-88,-117,40,99,109,100,44,109,111,100,41,58,10,
32,32,32,32,118,97,114,32,116,104,105,115,32,61,32,123,125,10,
10,
32,32,32,32,116,104,105,115,46,80,32,61,32,115,121,115,95,112,111,112,101,110,40,99,109,100,44,109,111,100,41,10,
10,
32,32,32,32,105,102,32,33,116,104,105,115,46,80,32,58,32,114,101,116,117,114,110,32,110,117,108,108,32,59,10,
10,
32,32,32,32,100,101,102,32,116,104,105,115,46,-27,-122,-103,40,115,41,58,10,
32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,115,121,115,95,112,119,114,105,116,101,40,116,104,105,115,46,80,44,115,41,10,
32,32,32,32,59,32,32,10,
32,32,32,32,100,101,102,32,116,104,105,115,46,-24,-81,-69,40,105,41,58,10,
32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,115,121,115,95,112,114,101,97,100,40,116,104,105,115,46,80,44,105,41,10,
32,32,32,32,59,10,
32,32,32,32,100,101,102,32,116,104,105,115,46,-27,-123,-77,-23,-105,-83,40,41,58,10,
32,32,32,32,32,32,32,32,114,101,116,117,114,110,32,115,121,115,95,112,99,108,111,115,101,40,116,104,105,115,46,80,41,10,
32,32,32,32,59,10,
10,
32,32,32,32,114,101,116,117,114,110,32,116,104,105,115,10,
59,32,10,
10,
100,101,102,32,-25,-77,-69,-25,-69,-97,46,-24,-80,-125,-25,-108,-88,40,99,109,100,41,58,10,
32,32,32,32,114,101,116,117,114,110,32,115,121,115,95,115,121,115,116,101,109,40,99,109,100,41,10,
59,10,
10,
10,
0};
#endif
void ElsLib_stdsys_libinit(els_VmObj *vm){
	vm_register(vm,"sys_getos",ELSAPI_stdsys_sys_getos);
	vm_register(vm,"sys_pclose",ELSAPI_stdsys_sys_pclose);
	vm_register(vm,"sys_popen",ELSAPI_stdsys_sys_popen);
	vm_register(vm,"sys_pwrite",ELSAPI_stdsys_sys_pwrite);
	vm_register(vm,"sys_getenv",ELSAPI_stdsys_sys_getenv);
	vm_register(vm,"sys_pread",ELSAPI_stdsys_sys_pread);
	vm_register(vm,"sys_system",ELSAPI_stdsys_sys_system);
	#ifdef ELS_CONF_TOKEN_EN
		vm_dostring(vm,LibScript);
	#endif
	#ifdef ELS_CONF_TOKEN_CN
		vm_dostring(vm,LibScript_cn);
	#endif
};
